package com.task;

import com.dao.RefreshChartDao;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.sql.SQLException;
import java.time.LocalDate;
import java.time.LocalTime;

@Component
public class ChartTask {
    @Resource
    RefreshChartDao refreshChartDao;
    @Scheduled(cron = "0/15 * * * * *") // 间隔5分钟执行
    public void taskChartSynch() throws SQLException, ClassNotFoundException {
         refreshChartDao.refreshCountStudentChartByClazz();
        System.out.println(LocalDate.now()+ " " + LocalTime.now() +" springmvc定时任务");
    }
}
